package com.sj.androidbasedemo;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {
	
	public final static String EXTRA_MESSAGE = "Text_message";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		//todo 取消应用里面的title
		//requestWindowFeature(Window.FEATURE_NO_TITLE);
		//todo 取消系统的title  相当于完全全屏  manifest也可以设置
		//getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		getWindow().setBackgroundDrawableResource(R.drawable.haigui);
		
		setContentView(R.layout.activity_main);
	}
	
	public void sendMessage(View view){
		Toast.makeText(this, "button clicked", Toast.LENGTH_SHORT).show();
		Intent intent = new Intent(this,DisplayMessageActivity.class);
		EditText editText = (EditText) findViewById(R.id.edit_message);
		String text = editText.getText().toString();
		intent.putExtra(EXTRA_MESSAGE, text);
		startActivity(intent);
	}
	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
